home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
tpdb314.zip
/
SORTDEMO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-01-31
|
727b
|
25 lines
PROGRAM SortDemo;
{TPDB Version 3.14}
{Copyright 1991 Brian Corll}
Uses Crt,TPDB,TPDBSort,TPDBStr;
{Declare a FAR function which creates the sort key expression.}
{This function MUST call the SortFile object, as shown.}
{$F+}
FUNCTION MakeKey : DBKey;{This function MUST return the type DBKey !}
BEGIN
MakeKey := Substr(For2Eng(SortFile^.Field(1),ForTable,EngTable),1,1);
END;
{$F-}
BEGIN
Writeln('Sorting TEST.DBF to SORT.DBF....');
{Set the VAR SortFunc equal to the sort key function.}
SortFunc := MakeKey;
{Then call the sort with the SortFunc VAR and the input and output files.}
SortOn(SortFunc,'test.dbf','sort.dbf');
Writeln('Sort complete !');
END.